package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.Talk;
import com.ruoyi.system.domain.dto.TalkBackDTO;
import com.ruoyi.system.domain.dto.TalkDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface TalkMapper {
    Integer getViewTotal();

    List<TalkDTO> getTalkByUserId(@Param("userId") Long userId);
    //获取首页说说列表
    List<TalkDTO> getAllTalks(Long userid);

    //根据id查看说说
    TalkDTO getTalkById(Long userId,@Param("talkId") Long talkId);

    List<TalkBackDTO> listBackTalks();

    TalkBackDTO getBackTalkById(Long userid,@Param("talkId") Long talkId);

    int saveTalk(Talk talk);

    int updateTalk(Talk talk);

    void deleteTalk(Long id);

    int updateViews(Long id);

    int getCommentCountById(Long id);
}
